#ifndef ZONEINTERFACE_H
#define ZONEINTERFACE_H

#include <QtCore>

#include <defs/global.h>
#include <core/entityobject.h>
#include <extensions/context.h>

namespace Optra {
    /*!
      Namespace defines Zone Classes to use in Optra
      */
    namespace Extensions{

        O_PRIVATE_DECLARE(ZoneInterface);
        class EXTENSIONS_EXPORT ZoneInterface
        {
        public:
            ZoneInterface();
            virtual ~ZoneInterface();

            /*!
              Zone dependency from other zones.
              Without any zones returned by this method
              Current zone don't be loaded (with it dependency)
              */
            virtual QStringList requiredDependency()const;

            /*!
              Zones required for some functions. Those zones are
              not required to start, but they are need for functionality
              */
            virtual QStringList functionalDependency()const;

            /*!
              Zones required by some futures.
             */
            virtual QStringList futureDependency()const;

            const QString& name()const;

            const ContextPtr& context()const;
            void setContext(const ContextPtr& ctx);

            virtual Opl::Core::EntityObject* object()const;
            void setObject(Opl::Core::EntityObject* obj);

            virtual void initialize() = 0;
            virtual void finalize() = 0;
            virtual void execute() = 0;

        protected:
            void setName(const QString& name);
        private:
            O_PRIVATE_DECLARE_MEMBER(ZoneInterface)
        };


    };};

Q_DECLARE_INTERFACE(Optra::Extensions::ZoneInterface, "org.optra.Zones.ZoneInterface/1.0")

#endif // ZONEINTERFACE_H
